package com.ruoyi.net.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.domain.ElementBusiMtnChannelVeth;
import com.ruoyi.net.domain.ElementBusiMtnChannelVethListVo;
import com.ruoyi.net.mapper.ElementBusiMtnChannelVethMapper;
import com.ruoyi.net.service.IElementBusiMtnChannelVethService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 网元-业务-MTN Channel-VETH接口Service业务层处理
 * 
 * @author tony
 * @date 2024-12-08
 */
@Service
public class ElementBusiMtnChannelVethServiceImpl implements IElementBusiMtnChannelVethService 
{
    @Autowired
    private ElementBusiMtnChannelVethMapper elementBusiMtnChannelVethMapper;

    /**
     * 查询网元-业务-MTN Channel-VETH接口
     * 
     * @param id 网元-业务-MTN Channel-VETH接口主键
     * @return 网元-业务-MTN Channel-VETH接口
     */
    @Override
    public ElementBusiMtnChannelVeth selectElementBusiMtnChannelVethById(String id)
    {
        return elementBusiMtnChannelVethMapper.selectElementBusiMtnChannelVethById(id);
    }

    /**
     * 查询网元-业务-MTN Channel-VETH接口列表
     * 
     * @param elementBusiMtnChannelVeth 网元-业务-MTN Channel-VETH接口
     * @return 网元-业务-MTN Channel-VETH接口
     */
    @Override
    public List<ElementBusiMtnChannelVethListVo> selectElementBusiMtnChannelVethList(ElementBusiMtnChannelVeth elementBusiMtnChannelVeth)
    {
        return elementBusiMtnChannelVethMapper.selectElementBusiMtnChannelVethList(elementBusiMtnChannelVeth);
    }

    /**
     * 新增网元-业务-MTN Channel-VETH接口
     * 
     * @param elementBusiMtnChannelVeth 网元-业务-MTN Channel-VETH接口
     * @return 结果
     */
    @Override
    public int insertElementBusiMtnChannelVeth(ElementBusiMtnChannelVeth elementBusiMtnChannelVeth)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiMtnChannelVeth.getId())) {
            elementBusiMtnChannelVeth.setId(uuid);
        }
        elementBusiMtnChannelVeth.setCreateBy(SecurityUtils.getUsername());
        elementBusiMtnChannelVeth.setCreateTime(DateUtils.getNowDate());
        elementBusiMtnChannelVeth.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnChannelVeth.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnChannelVethMapper.insertElementBusiMtnChannelVeth(elementBusiMtnChannelVeth);
    }

    /**
     * 修改网元-业务-MTN Channel-VETH接口
     * 
     * @param elementBusiMtnChannelVeth 网元-业务-MTN Channel-VETH接口
     * @return 结果
     */
    @Override
    public int updateElementBusiMtnChannelVeth(ElementBusiMtnChannelVeth elementBusiMtnChannelVeth)
    {
        elementBusiMtnChannelVeth.setUpdateBy(SecurityUtils.getUsername());
        elementBusiMtnChannelVeth.setUpdateTime(DateUtils.getNowDate());
        return elementBusiMtnChannelVethMapper.updateElementBusiMtnChannelVeth(elementBusiMtnChannelVeth);
    }

    /**
     * 批量删除网元-业务-MTN Channel-VETH接口
     * 
     * @param ids 需要删除的网元-业务-MTN Channel-VETH接口主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnChannelVethByIds(String[] ids)
    {
        return elementBusiMtnChannelVethMapper.deleteElementBusiMtnChannelVethByIds(ids);
    }

    /**
     * 删除网元-业务-MTN Channel-VETH接口信息
     * 
     * @param id 网元-业务-MTN Channel-VETH接口主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiMtnChannelVethById(String id)
    {
        return elementBusiMtnChannelVethMapper.deleteElementBusiMtnChannelVethById(id);
    }
}
